/*
 * User: user
 * Date: 03/05/2008
 * Time: 01:30:45
 */
package org.conann;

import java.lang.annotation.Annotation;

public class Scope {

    private final Class<? extends Annotation> type;

    public Scope(Class<? extends Annotation> type) {
        this.type = type;
    }

    public Class<? extends Annotation> getType() {
        return type;
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (other == null || getClass() != other.getClass()) {
            return false;
        }

        Scope scope = (Scope) other;
        return !(type != null ? !type.equals(scope.getType()) : scope.getType() != null);
    }

    @Override
    public int hashCode() {
        return type != null ? type.hashCode() : 0;
    }

    @Override
    public String toString() {
        return type.getSimpleName();
    }
}